package edu.zcmu.seckill.controller;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: tang
 * @Date: 2022/02/18/16:08
 * @Description:
 */
@RestController
@RequestMapping("/mqMessageController")
public class TestController {
    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @RequestMapping("/pushMessage")
    public Integer get(@RequestParam("id") int id) {
        rocketMQTemplate.convertAndSend("first-topic","你好,Java旅途" + id);
        return id;
    }

}
